package io.geekidea.boot.materialrule.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.geekidea.boot.materialrule.dto.addMaterialRule;
import io.geekidea.boot.materialrule.dto.updateMaterialRule;
import io.geekidea.boot.materialrule.entity.MaterialRule;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface MaterialRuleMapper extends BaseMapper<MaterialRule> {


    @Insert("insert into  tb_material_overdue_rule(rulesName,minTime,maxTime) values (#{rulesName},#{minTime},#{maxTime})")
    int  addMaterialRule(addMaterialRule addMaterialRule);



    @Update("update tb_material_overdue_rule set rulesName=#{rulesName},minTime = #{minTime},maxTime=#{maxTime},updatedTime=now() where id= #{id}")
    int  updateMaterialRule( updateMaterialRule updateMaterialRule);
}
